<template>
	<view>
		<!-- <view style="margin: 30rpx;">
			<view class="label">举报类型</view>
			<view class="tag-view">
				<uni-tag class="tag"  :text="item" :type="checkedItem==item?'primary': 'default'" :circle="true" v-for="(item, index) in types" :key="index"
				@click="change(item)"></uni-tag>
			</view>
		</view> -->
		<view class="label" style="margin-top: 50rpx; margin-left: 30rpx;">举报内容</view>
		<view class="content">
			<textarea v-model="message" placeholder="请输入举报内容"/>
		</view>
		
		<view class="btn" @click="submit">提交</view>
	</view>
</template>

<script>
	import RouteUtil from '@/main/common/RouteUtil';
	export default{
		data(){
			return{
				otherUserId: '',
				message: '',
				types:['恶意骚扰', '诈骗', '政治暴恐', '盗用侵权', '传播谣言', '其他' ],
				checkedItem: '',
			}
		},
		onLoad(option) {
			this.otherUserId = option.userId;
		},
		methods:{
			change(item){
				this.checkedItem = item;
			},
			async submit(){
				if(''==this.message){
					uni.$toast.showToast("请输入举报内容")
					return
				}
				// if(''==this.content){
					// this.$common.showToast("请选择举报类型")
				// 	return
				// }
				uni.$http.post('/api/report/saveReport', params).then(res=>{
					uni.$toast.showToast("举报成功")
					RouteUtil.back()
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	
	.content{
		width: 100wh;
		height: 200rpx;
		border: 1rpx solid #cccccc;
		margin: 30rpx;
		padding: 20rpx;
		border-radius: 20rpx;
	}
	
	.label{
		margin-bottom: 30rpx;
		font-size: 36rpx;
		color: #222;
	}
	
	.tag-view{
		display: flex;
		flex-direction: row;
		width: 100%;
		flex-wrap: wrap;
		-webkit-flex-wrap: wrap;
		
		.tag{
			margin: 10rpx 10rpx;
		}
	}
	
	.btn{
		margin: 100rpx 30rpx;
		box-sizing: border-box;
		background-image: linear-gradient(to right, #9fe9ff, #ab7aff);
		border-radius: 40rpx;
		width: 100wh;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		color:white;
	}
	
</style>